//获取应用实例
var a = -1;
var b = -1;
var c = -1;
Page({
	data:{
		items:[
		{name: 'USA', value: '美国'},
	    {name: 'CHN', value: '中国', checked: 'true'},
	    {name: 'BRA', value: '巴西'}]
	},
	offWrap:function(){
		this.setData({
			show:'none',
			states:6
		})
	},
	radioChange: function(e) {
    	console.log('radio发生change事件，携带value值为：', e.detail.value)
    	this.setData({
			show:'none',
			states:6
		})
  	},
	changeBoxBtn: function (e) {
		// console.log(e.target.dataset.num)
		var num = e.target.dataset.num;
		var states=null;
		if (num == 0) {
			states=0;
			a += 1;
			b = -1;
			c = -1;
			this.setData({
				show:'block'
			})

			if(a%2 == 1){
				states = 6;
				this.setData({
					show:'none'
				})
			}
		} else if(num == 1) {
			states = 1;
			a = -1;
			b += 1;
			c = -1;
			this.setData({
				show:'block'
			})
			if (b % 2 == 1) {
				states = 6;
				this.setData({
					show:'none'
				})
			}
		} else if (num == 2) {
			states = 2;
			a = -1;
			b = -1;
			c += 1;
			this.setData({
				show:'block'
			})
			if (c % 2 == 1) {
				states = 6;
				this.setData({
					show:'none'
				})
			}
		}
		// console.log(states)
		this.setData({
			states: states
		})
	}
})
